package com.vkserver.server;

import com.vkserver.services.DBManager;
import com.vkserver.services.utils.StatisticData;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 *@author roman.prudkogliad@gmail.com
 */

@Path("/statistic/{userId}/{sex}")
public class StatisticResource {

    @GET
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public StatisticData addAnswer(@PathParam("userId") long userId,
                            @PathParam("sex") int sex) {
        return DBManager.getInstance().getStatistic(userId, sex);
    }
}
